from selenium.webdriver.common.by import By
from base.basicFunction import *


def recharge_record_query():
    logger.info("-" * 30 + "充值记录查询" + "-" * 30)
    # 1
    wait_for_load((By.XPATH, '//*[@id="queryCond"]/ul/li[7]/div[2]/span/span'))  # 开始时间
    sleep(2)
    Element((By.XPATH, '//*[@id="_Wade_DropDownCalendar"]/div[1]/div[3]/span[1]')).click()  # 灯检机2022
    sleep(2)
    Element((By.XPATH, '//*[starts-with(text(),"2019")]')).click()  # 2019
    sleep(2)
    Element((By.XPATH, '//*[starts-with(text(),"2月")]')).click()  # 2月
    sleep(2)
    Element((By.XPATH, '//*[@id="_Wade_DropDownCalendar"]/div[7]/button[3]')).click()  # 确定
    sleep(2)
    Element((By.XPATH, '//*[@id="queryCond"]/ul/li[8]/div[2]/span/span')).click()  # 结束时间
    sleep(2)
    Element((By.XPATH, '//*[@id="_Wade_DropDownCalendar"]/div[1]/div[3]/span[1]')).click()
    sleep(2)
    Element((By.XPATH, '//*[starts-with(text(),"2020")]')).click()  # 2020年
    sleep(2)
    Element((By.XPATH, '//*[starts-with(text(),"1月")]')).click()  # 1月
    sleep(2)
    Element((By.XPATH, '//*[@id="_Wade_DropDownCalendar"]/div[7]/button[3]')).click()  # 确定
    sleep(2)
    Element((By.XPATH, '//*[@id="queryCond"]/ul/Li[10]/div/button[2]')).click()  # 点击查询按钮
    logger.info("-" * 28 + "充值记录查询完成" + "-" * 28)
